package server.synchronization;

import java.util.ArrayList;

import server.Connection;

public class LockListElement
{
	private final ArrayList<Integer> lockedServerIds;
	
	public LockListElement()
	{
		lockedServerIds = new ArrayList<Integer>();
	}
	
	public void removeLockedServerId(int id)
	{
		lockedServerIds.remove(id);
	}
	public void addLockedServerId(int id)
	{
		lockedServerIds.add(id);
	}
	public boolean canRelease(int connectedServerCount)
	{
		return lockedServerIds.size() == connectedServerCount;
	}
}
